#include "lom-root.hh"
#include "lom-instance-manager.hh"

namespace lom
{
    LomRoot::LomRoot() : handle(0), mgr(NULL){}
    void LomRoot::initializeLomRoot( ILomInstanceManager* _mgr, THandle reservedHandle ) {
	if ( handle && mgr )
	    mgr->deregister( handle );
	handle = 0;
	mgr = _mgr;

	if( mgr )
	    handle = mgr->doregister(this, reservedHandle);
    }
    LomRoot::~LomRoot() { if ( mgr && handle ) mgr->deregister( handle ); handle = 0; }
}
